package com.lk.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.lk.constant.RabbitmqConst;
import com.lk.model.User;
import com.lk.util.RabbitMqUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author : lk
 * @date 2021/11/10 11:23
 * @description : TODO
 * @since 1.0
 **/
@RestController
public class SendController {


    @Resource
    private RabbitMqUtil rabbitMqUtil;

    @GetMapping("send")
    public String send() {
        User user = new User();
        user.setUsername("admin");
        user.setPassword("password");
        rabbitMqUtil.sendMessage(RabbitmqConst.EXCHANGE_LOCALHOST_TEST, RabbitmqConst.QUEUE_LOCALHOST_TEST, user);
        return "success";
    }
}
